{% extends 'assets/base.html' %}
{% block content %}
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-lg-10">
            <h2>服务列表 | List Service.</h2>
        </div>
        <div class="col-lg-2">
        </div>
    </div>

    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5> 服务列表 </h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user"></ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>

                <div class="ibox-content">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th class="text-center">服务名称</th>
                            <th class="text-center">端口</th>
                            <th class="text-center">备注</th>
                            <th class="text-center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for services in services_list_objs %}
                            <tr>
                                <td class="text-center">{{ services.name }}</td>
                                <td class="text-center">{{ services.port }}</td>
                                <td class="text-center">{{ services.remark }}</td>
                                <td class="text-center">
                                    <div class="btn-group" data-toggle="buttons">
                                        <a href="{% url 'services_update' pk=services.pk %}"
                                           class="btn btn-xs btn-success " data-toggle="modal">修改</a>
                                        <a href="{% url 'services_delete' pk=services.pk %}"
                                           class="btn btn-xs btn-danger" data-toggle="modal">删除</a>
                                    </div>
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>

                    <div class="row">
                        <div class="col-sm-6">
                            {% if request.user.is_superuser or request.session.fun_auth.add_project %}
                                <a href="{% url 'services_create' %}" type="button" class="btn btn-info">添加服务</a>
                            {% endif %}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock content %}





